run:
  # default concurrency is a available CPU number
  concurrency: 4

  # timeout for analysis, e.g. 30s, 5m, default is 1m
  timeout: 1m

  # exit code when at least one issue was found, default is 1
  #issues-exit-code: 1

  # include test files or not, default is true
  tests: false

  # list of build tags, all linters use it. Default is empty list.
#  build-tags:
#    - mytag

#  skip-dirs:
#    - src/external_libs
#    - autogenerated_by_my_lib

  # default is true. Enables skipping of directories:
  #   vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
#  skip-dirs-use-default: true

#  skip-files:
#    - ".*\\.my\\.go$"
#    - lib/bad.go

#  modules-download-mode: readonly|vendor|mod

  # Allow multiple parallel golangci-lint instances running.
  # If false (default) - golangci-lint acquires file lock on start.
  allow-parallel-runners: false


linters:
  #enable-all: true
  disable-all: true
  enable:
    - gosec
    - gocritic
    - bodyclose
    - depguard
    - gosimple
    - govet
    - staticcheck
    - stylecheck
    - typecheck
    - dupl
    - prealloc
#  disable:
#    - typecheck

issues:
  exclude-use-default: false


linters-settings:
  gosec:
    # Available rules: https://github.com/securego/gosec#available-rules
    #includes:
    #  - G101
    #excludes:
    #  - G204
    # https://github.com/securego/gosec#configuration
    # https://github.com/securego/gosec/blob/569328eade2ccbad4ce2d0f21ee158ab5356a5cf/rules/rulelist.go#L60-L102
    config:
      G306: "0600"
      G101:
        pattern: "(?i)passwd|pass|password|pwd|secret|private_key|token|csrf|private"
        ignore_entropy: false
        entropy_threshold: "80.0"
        per_char_threshold: "3.0"
        truncate: "32"
  gocritic:
    enabled-tags:
      - diagnostic
      #- experimental
      - opinionated
      - performance
      - style
    disabled-checks:
      - dupImport # https://github.com/go-critic/go-critic/issues/845
#      - ifElseChain
#      - octalLiteral
#      - whyNoLint
#      - wrapperFunc
      - commentFormatting
  govet:
    check-shadowing: false
    settings:
      printf:
        funcs:
          - (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof
          - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
          - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
          - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
    enable:
      - atomicalign
    enable-all: false
#    disable-all: true
  dupl:
    threshold: 100
  prealloc:
    simple: true
    range-loops: true
    for-loops: true
  stylecheck:
    disabled-checks:
      - ST1003
